From: Aaron Schulz Date: Wed, 6 May 2015 03:54:44 +0000 (-0700) Subject: Removed duplicated jobs in triggerOpportunisticLinksUpdate() X-Git-Tag: 1.31.0-rc.0~11490 X-Git-Url: http://git.cyclocoop.org/%22.%24match%5B1%5D.%22?a=commitdiff_plain;h=c6ea60543b7b5a2cfca9a6a9bf99f5dfc2f45435;p=lhc%2Fweb%2Fwiklou.git Removed duplicated jobs in triggerOpportunisticLinksUpdate() * They get deduplicated on final insertion, but de-duplication them on initial insertion (EnqueueJob) to avoid any build-up there. Change-Id: Ia06f2bdf59a7e57fddb22890aa0b39420c0bfa7d --- diff --git a/includes/jobqueue/JobSpecification.php b/includes/jobqueue/JobSpecification.php index 327a18f95a..9ace1ba54e 100644 --- a/includes/jobqueue/JobSpecification.php +++ b/includes/jobqueue/JobSpecification.php @@ -97,7 +97,7 @@ class JobSpecification implements IJobSpecification { /** * @param string $type * @param array $params Map of key/values - * @param array $opts Map of key/values + * @param array $opts Map of key/values; includes 'removeDuplicates' * @param Title $title Optional descriptive title */ public function __construct( diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index e938ca84bc..cc182a4258 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -3412,7 +3412,8 @@ class WikiPage implements Page, IDBAccessObject { // Check if the last link refresh was before page_touched if ( $this->getLinksTimestamp() < $this->getTouched() ) { JobQueueGroup::singleton()->push( EnqueueJob::newFromLocalJobs( - new JobSpecification( 'refreshLinks', $params, array(), $this->mTitle ) + new JobSpecification( 'refreshLinks', $params, + array( 'removeDuplicates' => true ), $this->mTitle ) ) ); return; }